{% from "macros/table.html" import table, table_decoration %}

{% set columns = columns | default([
  {'title': 'name', 'field': 'name', 'sortable': True, 'renderer': None},
  {'title': 'description', 'field': 'description', 'sortable': False, 'renderer': None}
]) %}

{% set actions = actions | default([]) %}
{% set data = model_plural_name | get_var %}
{% set table_container = model_name + '-table-container' %}

<div id="{{ table_container }}" class="table-container" x-data="{ selectedItems: [] }">
  {{ table_decoration(name, model_name, table_container, routes=routes) }}
  {{ table(model_name + '-table', data, columns, actions=actions, standalone=false, routes=routes) }}
</div>
